package com.andy.web.dao;

import com.andy.domain.model.User;

public class UserShardingDataSourceRule extends ShardingDataSourceRule{

	@Override
	int doSharding(Object param, int dsCount) {
		if(param instanceof User) {
			User user  = (User) param;
			return (int)(user.getId() % dsCount);
		}
		return 0;
	}

	@Override
	String getTableName() {
		return null;
	}

}
